import VueRouter from 'vue-router'
import Home from '@/pages/Annual/Home'
import Annual from '@/pages/Annual'
import Forum from '@/pages/Forum'

const router = new VueRouter({
    mode: 'history',
    base: process.env.VUE_APP_BASE_URL,
    routes: [
        {
            path: "/",
            name: 'AnnualHome',
            redirect: "/home",
            component: Annual,
            children: [
                {
                    path: "/home",
                    component:  () => import('@/pages/Annual/Home')
                },
                {
                    path: "/schedule",
                    component: () => import('@/pages/Annual/Schedule')
                },
                {
                    path: "/2",
                    component: Home
                },
                {
                    path: "/3",
                    component: Home
                },
                {
                    path: "/4",
                    component: Home
                },
                {
                    path: "/newsCenter",
                    component:  () => import('@/pages/Annual/NewsCenter')
                },
                {
                    path: "/serviceCenter",
                    component:  () => import('@/pages/Annual/ServiceCenter')
                },
                {
                    path: "/contactUs",
                    component: () => import('@/pages/Annual/ContactUs')
                },
            ]
        },
        {
            path: "/forum",
            component: Forum
        },

    ]
})

//全局前置路由守卫 ：验证登录信息
router.beforeEach((to,from,next)=>{
    document.title = process.env.VUE_APP_TITLE
    next()
})

export default router;
